<?php

use think\migration\Seeder;

class AuthRuleSeeder extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $data =
            [
                'name' => 'Controller/action' . getRandStrByLength(1),
                'title' => '权限名称' . getRandStrByLength(2),
                'status' => mt_rand(0, 1),
                'method' => ['get','post','get/post','put'][array_rand(['get','post','get/post','put'])]
            ];
        $this->table('y_auth_rule')->insert($data)->save();
    }
}